﻿/**
 *
 * @file NCTDialogLayUp.h
 * @brief  多层声学包对话框声明
 * @author wangning (2185896382@qq.com)
 * @date 2024-12-16
 *
 */
#ifndef __GUINCTDialogLayUp_H__
#define __GUINCTDialogLayUp_H__

#include "AbstractPhysicsDialog.h"


class QComboBox;

namespace Ui
{
    class NCTDialogLayUp;
}

namespace Acoustics
{
    class FITKAcousticsNCTAbstractLayObj;
}

namespace GUI
{
    /**
     * @brief  多层声学包对话框
     * @author wangning (2185896382@qq.com)
     * @date 2024-12-11
     */
    class GUIPhyscisDialogAPI NCTDialogLayUp : public AbstractMaterialDialog
    {
        Q_OBJECT
    public:
        /**
         * @brief Construct a new NCT Dialog object
         * @param[i]  type           操作类型
         * @param[i]  nctid          声学包ID
         * @param[i]  parent         父对象
         * @author wangning (2185896382@qq.com)
         * @date 2024-12-11
         */
        explicit NCTDialogLayUp(PhysicsDlgExecType type, int nctid = -1, QWidget* parent = nullptr);
        /**
         * @brief Destroy the NCT Dialog object
         * @author wangning (2185896382@qq.com)
         * @date 2024-12-11
         */
        virtual ~NCTDialogLayUp();

    private slots:
        /**
         * @brief 确认按钮点击事件
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-12-06
         */
        void on_pushButton_OK_clicked();
        /**
         * @brief 取消按钮点击事件
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-12-06
         */
        void on_pushButton_Cancel_clicked();
        /**
         * @brief 删除按钮槽函数
         * @author wangning (2185896382@qq.com)
         * @date 2024-12-11
         */
        void on_pushButton_Delete_clicked();
        /**
         * @brief 编辑按钮槽函数
         * @author wangning (2185896382@qq.com)
         * @date 2024-12-11
         */
        void on_pushButton_Edit_clicked();
        /**
         * @brief 添加按钮槽函数
         * @author wangning (2185896382@qq.com)
         * @date 2024-12-18
         */
        void on_pushButton_Add_clicked();
        /**
         * @brief 插入按钮槽函数
         * @author wangning (2185896382@qq.com)
         * @date 2024-12-18
         */
        void on_pushButton_Insert_clicked();

    private:
        /**
         * @brief 初始化窗口
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-12-06
         */
        void init();
        /**
         * @brief 检查输入
         * @return true  输入没有错误
         * @return false  输入有错误
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-12-06
         */
        bool checkInput();
        /**
         * @brief 备份数据
         * @param[i]  data  原始数据
         * @return Acoustics::FITKAcousticsNCTAbstractLayObj* 复制后的数据指针
         * @author wangning (2185896382@qq.com)
         * @date 2024-12-11
         */
        Acoustics::FITKAcousticsNCTAbstractLayObj* copyLayerData(Acoustics::FITKAcousticsNCTAbstractLayObj* data);
        /**
         * @brief 填充数据到表格
         * @author wangning (2185896382@qq.com)
         * @date 2024-12-11
         */
        void refreshTableWidget();
        /**
         * @brief 更新厚度和面积
         * @author wangning (2185896382@qq.com)
         * @date 2024-12-11
         */
        void refreshThicknessArea();
    private:
        /**
         * @brief UI对象
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-12-06
         */
        Ui::NCTDialogLayUp *_ui{};
        /**
         * @brief  临时存储对象
         * @author wangning (2185896382@qq.com)
         * @date 2024-12-11
         */
        QList<Acoustics::FITKAcousticsNCTAbstractLayObj*> _dataList{};
    };
}
#endif